From: Florian Eckert Date: Fri, 21 Mar 2025 09:41:01 +0000 (+0100) Subject: acme: remove crontab entry if service is stopped X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=692f3afe4af84976f1a8cd8ba0aa1da8b6007c12;p=feed%2Fpackages.git acme: remove crontab entry if service is stopped Until now it was not possible to stop the acme service, because the handling was done via cron. With this change, the acme handler can now be stopped by calling '/etc/init.d/acme' stop. This call removes the entry from the crontab. Signed-off-by: Florian Eckert --- diff --git a/net/acme-common/files/acme.init b/net/acme-common/files/acme.init index d35a0a60e6..594e320087 100644 --- a/net/acme-common/files/acme.init +++ b/net/acme-common/files/acme.init @@ -150,6 +150,14 @@ service_started() { echo "Certificate renewal enabled via cron. To renew now, run '/etc/init.d/acme renew'." } +stop_service() { + sed -i '\|/etc/init.d/acme|d' /etc/crontabs/root +} + +service_stopped() { + echo "Certificate renewal is disabled." +} + service_triggers() { procd_add_config_trigger config.change acme \ /etc/init.d/acme renew